package com.wuchao.spring;

import com.github.pagehelper.PageInfo;
import com.wuchao.entity.Entry;
import com.wuchao.service.serviceimpl.EntryServiceImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author wuchao66
 * @Date 2023/9/27 10:36
 * @PackageName:com.wuchao.spring
 * @ClassName: T
 * @Description: TODO
 * @Param
 * @Version 1.0
 */
public class T {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext cpac =
                new ClassPathXmlApplicationContext("ApplicationContextProMax.xml");
      PageInfo<Entry> page =( (EntryServiceImpl)cpac.getBean("entryServiceImpl")).findByPage1(2, "1", 1, 3);
        System.out.println(page);
        page.getList().forEach(xjj->
                System.out.println(xjj.getId()+"\t"+xjj.getCategory().getName()+"\t"+xjj.getTitle()));

//       ( (EntryServiceImpl)cpac.getBean("entryServiceImpl")).
//               findEntryById(4).forEach(System.out::println);
    }
}
